

int missingNumber(int* nums, int numsSize) {
    int x = 0;
    for (int i = 0; i < numsSize; ++i) {
        x ^= nums[i];
    }
    for (int j = 0; j < numsSize + 1; ++j) {
        x ^= j;
    }

    return x;
}

int main() {
    int arr[] = {3, 1, 0, 4, 5};
    int sz = sizeof(arr)/sizeof(arr[0]);
    missingNumber(arr, sz);

    return 0;
}